using UnityEngine;
using System.Collections;
using System.Collections.Generic;

[ExecuteInEditMode]
public class PathMapBehaviour : SolidColorGizmo 
{
	public PathMap pathMap
	{
		get 
		{
			return m_pathMap;
		}
		set 
		{
			m_pathMap = value;
		}
	}
	
	public void AddPathJointController (PathJointBehaviour pathJointController)
	{
		m_pathJointControllers.Add (pathJointController);
		m_pathMap.AddPathJoint (pathJointController.pathJoint);
	}
	
	public void RemovePathJointController (PathJointBehaviour pathJointController)
	{
		m_pathJointControllers.Remove (pathJointController);
		m_pathMap.RemovePathJoint (pathJointController.pathJoint);
	}
	
	public void AddPathController (PathPairBehaviour pathController)
	{
		m_pathControllers.Add (pathController);
		pathController.pathMap = m_pathMap;
	}
	
	public void RemovePathController (PathPairBehaviour pathController)
	{
		m_pathControllers.Remove (pathController);
		if (pathController.pathPair != null)
		{
			m_pathMap.RemovePath (pathController.pathPair);
		}
	}
	
	public void Draw (SolidColorGizmo monoBehaviour)
	{
		// TODO implement this method
	}
	
	void Awake ()
	{
		m_pathJointControllers = new List<PathJointBehaviour> ();
		m_pathControllers = new List<PathPairBehaviour> ();
	}
	
	protected override void DrawGizmos ()
	{
		base.DrawGizmos ();
	}
	
	public List<PathJointBehaviour> m_pathJointControllers;
	
	public List<PathPairBehaviour> m_pathControllers;
	
	PathMap m_pathMap;
}
